<template>
    <!-- 图片box -->
    <view class="goods-img" @mousedown="mousedown" @dblclick="onDbClickHandler">
        <minMaxClose ref="minMaxClose"></minMaxClose>
        <view class="images">
            <image
                :src="avatar ? avatar : userDefault"
                mode="scaleToFill"
            ></image>
            <view class="customers">
                <view class="c-a">
                    {{ isShowName ? (name ? name : " 散客") : "" }}
                    <text class="c-a-pl" v-if="isShowCp">{{
                        company ? company : ""
                    }}</text>
                </view>
                <view class="c-b">{{ cellphone ? cellphone : "" }}</view>
            </view>
        </view>
        <view class="info-more">
            <view class="more-icon" @click="onInfoMore">
                <image src="../../static/images/c-more.png"></image>
            </view>
        </view>
    </view>
</template>

<script>
import cmd from "../../js/Cmd.js";
import lang from "../../js/conf/Lang.js";
import minMaxClose from "../min-max-close.vue";
import staticConst from "../../js/const/StaticConst.js";
import windBtnContrl from "../../js/WinBtnContrl.js";
export default {
    props: ["avatar", "name", "cellphone", "company", "isShowCp", "isShowName"],
    components: { minMaxClose },
    data() {
        return {
            userDefault: staticConst.DEFAULT_IMG,
        };
    },
    methods: {
        onInfoMore() {
            this.$emit("showCustmInfo");
        },

        onDbClickHandler() {
            this.$refs.minMaxClose.changeMax();
        },

        /***移动窗口***/
        mousedown() {
            windBtnContrl.mousedown();
        },
    },
};
</script>

<style lang="scss">
// 产品图片-box
.goods-img {
    width: 100%;
    height: 110px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    .images {
        display: flex;
        align-items: center;
        padding: 20px;
        position: relative;
        image {
            margin-right: 10px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            overflow: hidden;
        }

        .customers {
            .c-a {
                font-size: 16px;
                color: #333;
                .c-a-pl {
                    padding-left: 10px;
                }
            }
            .c-b {
                color: #999;
            }
        }
    }
    .info-more {
        padding-right: 20px;
        display: flex;
        .more-icon {
            width: 24px;
            height: 24px;
            cursor: pointer;
            padding: 0 10px;
            image {
                width: 100%;
                height: 100%;
            }
        }
    }
}
</style>
